package dy

import (
	"context"
	v1 "dy_spider/api/dy/v1"
	"dy_spider/internal/dao"
)

func (s *sDy) PostGiftRank(ctx context.Context, req *v1.PostGiftRankReq) (res *v1.PostGiftRankRes, err error) {
	data := map[string]string{
		"msg_id":     req.MsgId,
		"live_id":    req.LiveId,
		"user_id":    req.UserId,
		"nick_name":  req.NickName,
		"rank_level": req.RankLevel,
		"batch_date": req.BatchDate,
		"room_id":    req.RoomId,
	}
	_, err = dao.DyGiftRank.Ctx(ctx).Insert(data)
	if err != nil {
		return nil, err
	}
	return res, nil
}
